home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Family Forum 259
/
IND_GIANT.BIN
/
Xtras
/
Animation Wizard.dir
/
00003_Script_CheckBox
< prev
next >
Wrap
Text File
|
1997-05-10
|
1KB
|
58 lines
-- CheckBox script
property ichCheckBox
property iCurrentValue
on birth me
return me
end birth
on mInit me, chCheckBox, defaultValue
set ichCheckBox = chCheckBox
puppetSprite ichCheckBox, TRUE
if voidP(defaultValue) then
set iCurrentValue = TRUE
else
set iCurrentValue = defaultValue
end if
mDraw(me)
end mInit
on mDraw me
global gCastNumCheckBoxOn
global gCastNumCheckBoxOff
if iCurrentValue then
set the castnum of sprite ichCheckBox = gCastNumCheckBoxOn
else
set the castnum of sprite ichCheckBox = gCastNumCheckBoxOff
end if
updateStage
end mDraw
on mHit me
set iCurrentValue = not(iCurrentValue)
mDraw(me)
end mHit
on mGetValue me
return iCurrentValue
end mGetValue
on mSetValue me, theNewValue
if (theNewValue <> TRUE) and (theNewValue <> FALSE) then
alert("Bad value passed to mSetValue of CheckBox:" && theNewValue)
return
end if
set iCurrentValue = theNewValue
mDraw(me)
end mSetValue
on mCleanUp me
puppetSprite ichCheckBox, FALSE
end mCleanup